package com.px.dal;

import java.util.List;

import org.apache.ibatis.session.SqlSession;

import com.px.idal.ICompanyInfoMapper;
import com.px.model.CompanyInfo;
import com.px.mybatisunit.MyBatisUtil;

public class CompanyInfoMapper {
	// 创建SqlSession对象的实例
	SqlSession session = MyBatisUtil.getsqlSession(true);
	// IUserInfoMapper接口通过sqlsession的getmap方法,完成实现,全部自动化
	ICompanyInfoMapper mapper = session.getMapper(ICompanyInfoMapper.class);

	// 查询所有参加会员单位
	public List<CompanyInfo> getAllCompanyInfos() {
		return mapper.getAllCompanyInfos();
	}

	// 增加参加会员单位
	public int insertCompanyInfos(CompanyInfo company) {
		return mapper.insertCompanyInfos(company);
	};
	
	// 查询指定id的参加会员单位
	public List<CompanyInfo> getCompanyInfoByCompanyInfoId(CompanyInfo company) {
		return mapper.getCompanyInfoByCompanyInfoId(company);
	};
	// 更新指定指定id的参加会员单位
	public int updateCompanyInfoByCompanyInfoId(CompanyInfo company) {
		return mapper.updateCompanyInfoByCompanyInfoId(company);
	};

	// 删除指定指定id的参加会员单位
	public int deleteCompanyInfoByCompanyInfoId(Integer company_id) {
		return mapper.deleteCompanyInfoByCompanyInfoId(company_id);
	};

	// 查询参加会员单位信息总条数
	public int getAllCompanyInfoCounts() {
		return mapper.getAllCompanyInfoCounts();
	};

	// 查询指定参加会员单位名参加会员单位是否存在
	public int checkCompanyInfoIdIsExist(CompanyInfo company) {
		return mapper.checkCompanyInfoIdIsExist(company);
	}

}
